home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (c) 1988 by Caldera Corporation */
-
- /* PO box 3252, Ann Arbor, MI 48106 (313) 996-9059 */
-
- /* File: windows_init.c
- Compilers: LightSpeedC 3.0, Aztec C 3.0 */
-
- /* Abstract: */
- /* high level and code segment 1 routines for windows */
-
- /* History: */
- /* 2/10/89 1.0d - released final 1.0 version */
-
-
- #include <Compatability.h> /* handle compiler differences */
- #include <StdInclude.h> /* include required headers, etc */
- #include "windows.h" /* include globals, prototypes, etc */
-
- void Set_up_menus()
- {
- int i;
- MenuHandle subHdl;
-
- InitMenus(); /* initialize Menu Manager */
- for (i = 1; i <= MAXMENUS; i++)
- {
- menuHdls[i] = GetMenu(RESID_BASE + i);
- if (menuHdls[i] != NULL)
- InsertMenu(menuHdls[i], 0);
- }
- DrawMenuBar();
- if (menuHdls[1] != NULL)
- AddResMenu(menuHdls[1], 'DRVR'); /* add Desk Acc. from System*/
-
- subHdl = GetMenu(65); /* get submenu template */
- if (subHdl != NULL)
- InsertMenu(subHdl, -1); /* add but don't display in menubar */
- }
-
-
- void Init_all()
- {
- int i;
-
- InitGraf(&thePort); /* init Quickdraw and global variables */
- InitFonts(); /* initialize Font manager */
- InitWindows(); /* init Window manager, setup WMgr GrafPort */
- Set_up_menus(); /* routine to set up menubar */
- TEInit(); /* inititalize TextEdit */
- InitDialogs(NULL); /* initialize Dialog manager */
-
- dragRect = screenBits.bounds; /* set drag rect to size of screen */
- dragRect.top = dragRect.top - 20; /* adjust top for menu bar heigth */
- InsetRect(&dragRect,6,6); /* walk in from edges on four sides */
-
- done = FALSE; /* initialize Main Event Loop done flag */
-
- for (i=0; i<MAXWINDOWS; i++) /* initialize wPtrs array to unused */
- wPtrs[i] = NULL;
-
- limitRect = screenBits.bounds; /* set max rect to size of screen */
- limitRect.top = 50; /* set min rect to 50 pixels tall */
- limitRect.left = 50; /* set min rect to 50 pixels wide */
-
- FlushEvents(everyEvent, 0); /* clear the Event queue of all events */
-
- InitCursor(); /* set the cursor to arrow instead of clock */
- AllocWindow(); /* just for MacHack to bring up window/CDEF */
- }
-